package com.qire.manhua.model.vo;

import com.qire.common.support.base.BaseVO;
import com.qire.manhua.model.entity.ShareInfo;

public class ComicDetailVO extends BaseVO {

    public ShareInfoVO  shareInfo;      //: {ShareInfo}, 分享信息
    public DetailInfoVO detailInfo;     //: {DetailInfo},详情信息
    public ChapterVO    lastChapter;    //: {Chapter},   最后更新章节信息
    public CommentVO[]  commentBest;    //: [Comment...] 精品评论列表
    public RankInfoVO   rank;

    public class ShareInfoVO {
        public String title;    //: "最近发现一部超好看的漫画：小皇书VS小皇叔",
        public String desc;     //: "穿越成为一本悲催的小皇书，肩负无后为大的使命，务必让小皇叔膝下有猴子才能回去，就此踏上如何帮他重振雄...",
        public String img;      //: "https://p.qiremanhua.com/uploads/book/201811/5bee42b87ec3f.jpg?x-oss-process=image/resize,w_200",
        public String link;     //: "http://comic.qireshare.com/book/10548/0"

        public ShareInfo toShareInfo() {
            return new ShareInfo(title, desc, img, link);
        }
    }

    public class DetailInfoVO {

        public int      id;                         //: "10548",
        public String   book_name;                  //: "小皇书VS小皇叔",
        public String   book_cover;                 //: "https://p.qiremanhua.com/uploads/book/201811/5bee42b87ec3f.jpg",
        public String   book_author;                //: "重庆慢慢画",
        public String   book_intro;                 //: "穿越成为一本悲催的小皇书，肩负无后为大的使命，务必让小皇叔膝下有猴子才能回去，就此踏上如何帮他重振雄风的不归路！ 来，快上车，带你踏上华丽丽的穿越之旅！",
        public int      fee_type;                   //: "1",
        public int      app_fee_type;               //: "1",
        public int      end_state;                  //: "0", 0 :连载中  1：已完结
        public String   update_cycle;               //: "每周二、三、六更新",
        public String   restriction_time;           //: "0000-00-00",
        public String   app_restriction_time;       //: "0000-00-00",
        public String   restriction_start_time;     //: "0000-00-00",
        public String   app_restriction_start_time; //: "0000-00-00",
        public int      free_num;                   //: "31",           //vip 免费看章节数量 0 为看全本
        public int      app_free_num;               //: "31",
        public String[] tags;                       //: ["穿越","恋爱","奇幻"],
        public String   restriction_title;          //: "会员免费看31话",
        public String   fee_start_chapter;          //: "第21话 初吻没了",
        public int      all_free_num;               //: 0,
        public float    all_free_mm;                //: 0,
        public Copyright    copyright;                  //: {Copyright},
        public Statistics   tj;                         //: {Statistics},
        public int      shelf;                      //: 0,              //添加搜藏夹
        public int      read_chapter_px;            //: 1,
        public String   read_chapter_name;          //: "去你的小黄书",
        public String   read_subtitle;              //: "1话"
        public int      read_chapter_free;          //: 1               底部按钮，阅读记录，免费阅读&继续阅读区别 1=免费阅读，0-继续阅读

        /** 是否已完结 */
        public boolean isEnd() {
            return end_state == 1;
        }

        /** 最近阅读记录索引 */
        public int lastReadChapterIndex() {
            return Math.max(0, read_chapter_px - 1);
        }

        public class Copyright {
            public int      id;                         //: 82,
            public String book_copyright;             //: "慢慢画文化"
        }
        public class Statistics {
            public int read_cnt;                        //: 13096813,
            public int like_cnt;                        //: 5293,
            public int post_cnt;                        //: 38,
            public int shelf_cnt;                       //: 4358
        }

    }

    public class ChapterVO {
        public String   check_time; //: "2019-02-28",
        public String   subtitle;   //: "第98话 ",
        public int      chapter_px; //: 98
//        public void fillTo(ComicCatalogueViewModel comicCatalogueViewModel){
//            comicCatalogueViewModel.setLastChapter(comicCatalogueViewModel.new LastChapterItemViewModel(check_time,subtitle,chapter_px));
//        }
    }

    public class RankInfoVO {

        public RankItemVO[] loveRank;
        public BookRankTypeVO bookType;

        public class RankItemVO{
            public int      id;           //: 10775,
            public String book_name;    //: "女帝的后宫",
            public String book_author;  //: "Morel",
            public String short_title;  //: "一觉醒来竟然多了七个老公？",
            public String book_unruly;  //: "https://p.qiremanhua.com/uploads/book/201910/5db2c8c32e0df.jpg?x-oss-process=image/quality,q_90/format,webp",
            public int      end_state;    //: 0,
            public String read_cnt;     //: "46032895",
            public String[] tags;         //: ["恋爱","古风","穿越"]
        }
        public class BookRankTypeVO{
            public int      id;           //: 12,
            public String cate_name;    //: "穿越"
        }
    }

}
